﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Log4NetSql
{
    class Program
    {
        static void Main(string[] args)
        {
            try
            {
                log4net.Config.XmlConfigurator.Configure(new System.IO.FileInfo(AppDomain.CurrentDomain.BaseDirectory + "\\log4net.config"));

                AppOpLog opLog = new AppOpLog();
                opLog.IP = "192.0.1.111";
                opLog.ActionName = "action";
                opLog.ControllerName = "controller";
                opLog.ActionParam = "param";
                opLog.Url = "url";
                opLog.HttpHeader = "header";
                opLog.HttpMethod = "get";
                opLog.UserAgent = "useragent";
                opLog.StartTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
                opLog.EndTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
                opLog.RunTime = (Convert.ToDateTime(opLog.EndTime) - Convert.ToDateTime(opLog.StartTime)).TotalSeconds.ToString();
                LogHelper.LogError(opLog, new Exception("error"));
                Console.ReadKey();
            }
            catch (Exception ex)
            {

            }
        }
    }
}
